Skip to content

fix(auth): never enable dev login on production deployments#91

Merged
RikepilB merged 4 commits into
mainfrom
fix/resume-pipeline-and-notifications
Jun 11, 2026
Merged

fix(auth): never enable dev login on production deployments#91
RikepilB merged 4 commits into
mainfrom
fix/resume-pipeline-and-notifications

Conversation

@RikepilB

Copy link
Copy Markdown
Owner

Summary

  • Security: the dev credentials provider (any email → ADMIN) was enabled whenever Google OAuth credentials were missing — which is the current state of the Vercel production deployment, leaving admin sign-in open to anyone. Dev login is now restricted to NODE_ENV=development, with an explicit ALLOW_DEV_LOGIN=1 escape hatch for local prod-build smoke tests.
  • Sign-in UX: the Google button is hidden when OAuth is unconfigured (clicking it previously bounced back to /signin with zero feedback — the reported "click and it refreshes" loop). NextAuth ?error= codes now render as a visible alert, and a clear notice shows when no sign-in method is available.
  • Resumes: accept .txt uploads end-to-end (upload guard, schema message, accept attr). Extraction and inline preview already supported plain text.

Test plan

  • pnpm lint / pnpm typecheck / pnpm vitest run (196/196) / pnpm build
  • New unit tests: ALLOW_DEV_LOGIN matrix in auth.config.test.ts
  • Browser-verified locally: Google sign-in lands on /admin; PDF + DOCX inline embeds render; 5 sample resumes (PDF/TXT) parse COMPLETED with correct fields

Production follow-up

After merge + promote to master, set AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET, RESEND_API_KEY, EMAIL_FROM in Vercel production env and add the prod redirect URI in GCP.

🤖 Generated with Claude Code

RikepilB and others added 3 commits June 11, 2026 13:36
- docs/SETUP.md: correct RESUME_PARSE_MODE default (queue, not
  queue-and-inline) and document JOB_RUNNER=inline behavior without workers
- sign-in.test.ts: regression test proving lookalike/subdomain emails are
  rejected by the AUTH_ALLOWED_EMAIL_DOMAIN gate (endsWith(@ + domain)
  anchors on the @ separator, so no bypass exists)
- dispatch.test.ts: test documenting that inline admin fan-out is
  fire-and-forget — send failures land in EmailLog, not the returned result
The dev credentials provider (any email -> ADMIN) was registered whenever
Google OAuth credentials were missing, which left admin sign-in wide open
on deployments without AUTH_GOOGLE_* set. It is now restricted to
NODE_ENV=development, with an explicit ALLOW_DEV_LOGIN=1 escape hatch for
local production-build smoke tests.

Also on the signin page:
- hide the Google button when OAuth is not configured (clicking it
  previously bounced through /api/auth/signin back to /signin with no
  feedback - the reported refresh loop)
- surface NextAuth ?error= codes as a visible alert
- show a clear notice when no sign-in method is available

And accept .txt resumes end-to-end (upload guard, schema message, file
input accept list); text extraction and inline preview already support
plain text.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scoutlane Ready Ready Preview, Comment Jun 11, 2026 7:47pm

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 306f870f-c86b-4bad-99b1-5467eb74de83

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/resume-pipeline-and-notifications

Comment @coderabbitai help to get the list of available commands and usage tips.

- Add loading.tsx fallbacks for every admin segment (shared
  AdminPageSkeleton), the public careers job page, and the root job
  board, so navigation shows immediate skeleton/branded loading states
  instead of a frozen screen while server components stream.
- Add a shadcn-style Skeleton primitive.
- RescoreButton: surface success/error via toast (failures were
  silently swallowed); RetryParsingButton: toast on success/failure in
  addition to the inline error text.

Co-Authored-By: Claude <noreply@anthropic.com>
@RikepilB RikepilB merged commit 0da9ead into main Jun 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant